package com.yjs.app.trade.web.controller.business.statistics;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yjs.app.trade.core.util.MongoUtil;
import com.yjs.app.trade.core.util.PropertiesUtils;
import com.yjs.app.trade.service.mapper.business.member.MemberMapper;
import com.yjs.app.trade.service.mapper.business.product.ProductMapper;
import com.yjs.app.trade.service.service.sys.YearPriceService;
import com.yjs.app.trade.web.controller.base.BaseController;
import com.yjs.app.trade.web.controller.base.util.Result;
/**
 * 
 * 监管中心首页
 * @author jieY
 *
 */
@Controller
@RequestMapping(value = "/app/business/statistics/supervise")
public class SuperviseStatisticsController extends BaseController {
	
	public static String superviseUrl = PropertiesUtils.getProperty("supervise.url");
	
	@Autowired
	MemberMapper memberMapper;
	@Autowired
	ProductMapper productMapper;
	@Autowired
	YearPriceService yearPriceService;
	/**
	 * 查看今日订单信息
	 * @param data
	 * @param request
	 * @return
	 */
	@RequestMapping(value = "/findSuperviseHomePage", method = RequestMethod.GET)
	@ResponseBody
	public Object findSuperviseHomePage(String data, HttpServletRequest request) {
		String mongoDbCollection="superviseHomePage";
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("member", memberMapper.findSuperviseMember());
		map.put("appar", productMapper.findSuperviseProductAppar());
		map.put("drug", productMapper.findSuperviseProductDrug());
		map.put("orderInfo", MongoUtil.getListInfo(mongoDbCollection, null, null, null, null, null));
		map.put("yearPrice", yearPriceService.findYearPrice());
		map.put("superviseUrl", superviseUrl);
		//System.out.println("map:"+map.toString());
		return Result.csuccess(map);
	}
}
